
(function(){
	var BBLibDesigner = G.GClass('APP', 'BBLibDesigner');

	BBLibDesigner.prototype.__init = function(board) 
	{
		this.board = board;
	}


	BBLibDesigner.prototype.run = function() 
	{
		console.log("lib designer run.");
		this.board.load_hot_key({
			'p': {
					'l': {func: this.board.draw_line, obj: this.board},
					'r': {func: this.board.draw_rect, obj: this.board},
					'p': {func: this.board.draw_polyline, obj: this.board},
					's': {func: this.board.draw_polygon, obj: this.board}
			},
			'i': {func: this.board.zoom_in, obj: this.board},
			'o': {func: this.board.zoom_out, obj: this.board},
			'q': {func: this.board.enter_select_mode, obj: this.board},
			'u': {func: this.board.undo, obj: this.board},
			'r': {func: this.board.redo, obj: this.board}
		});
	}

	BBLibDesigner.prototype.load_symbol = function(sym)
	{
		this.board.clear();
		this.board.draw_symbol(sym);
	}

	BBLibDesigner.prototype.save_symbol = function()
	{
		var sym = this.board.get_picture();
		alert(sym);
	}

	BBLibDesigner.prototype.add_pin = function()
	{
	}

	BBLibDesigner.prototype.del_pin = function()
	{
	}

	BBLibDesigner.prototype.set_name = function()
	{
	}

 })();
